package com.gee.spring.boot.rpf.client.mblno.oltime.ctcc;

import com.gee.spring.boot.rpf.client.AbstractClient;
import com.gee.spring.boot.rpf.client.mblno.oltime.cmcc.CMCCOnlineTimeResponse;
import com.gee.spring.boot.rpf.util.CommonUtil;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

/**
 * desc:
 *
 * @author gee wrote on  2020-10-16 15:34:08
 */
@Component
@Scope("prototype")
public class CTCCOnlineTimeClient extends AbstractClient<CTCCOnlineTimeRequest, CTCCOnlineTimeResponse> {

    @Override
    public String getCacheKey(CTCCOnlineTimeRequest req) {
        return CommonUtil.buildRequestCacheKey(req.getMblNo());
    }

    @Override
    public CTCCOnlineTimeResponse call(CTCCOnlineTimeRequest clientRequest) throws Exception {
        Thread.sleep(1000);
        CTCCOnlineTimeResponse response = new CTCCOnlineTimeResponse();
        response.setCode("000000");
        response.setMsg("调用成功");
        response.setOnlineTime(24);
        return response;
    }
}
